#include "StdAfx.h"
#include "LineWidthData.h"


CLineWidthData::CLineWidthData(void)
{
}


CLineWidthData::~CLineWidthData(void)
{
}

void CLineWidthData::DrawItem( CDC* pDC, const CRect& rc, BOOL bSelected )
{
	CRect rcDraw(rc) ;
	COLORREF	crBackground, crText ;
	if(bSelected)
	{
		crBackground = GetSysColor(COLOR_HIGHLIGHT) ;
		crText = GetSysColor(COLOR_HIGHLIGHTTEXT) ;
	}
	else
	{
		crBackground = GetSysColor(COLOR_WINDOW) ;
		crText = GetSysColor(COLOR_WINDOWTEXT) ;
	}
	pDC->SetBkColor(crBackground) ;
	ExtTextOut(pDC->GetSafeHdc(), 0,0,ETO_OPAQUE, rcDraw, NULL, 0,NULL) ;
	//use the data m_nLineWidth
	CPen NewPen(0, m_nLineWidth, RGB(0,0,0)) ;
	CPen* pOldPen = pDC->SelectObject(&NewPen) ;
	pDC->MoveTo(rcDraw.left, (rcDraw.top+rcDraw.bottom )/2) ;
	pDC->LineTo(rcDraw.left+80, (rcDraw.top+rcDraw.bottom)/2) ;
	pDC->SelectObject(pOldPen) ;
	rcDraw.left+=80 + 5 ;

	pDC->SetBkColor(crBackground) ;
	pDC->SetTextColor(crText) ;
	pDC->DrawText(m_strWname, m_strWname.GetLength(), rcDraw,DT_SINGLELINE|DT_VCENTER|DT_LEFT) ;
}
